# Packager: Justin Davis <jrcd83@gmail.com>
# $Id: PKGBUILD 180338 2013-03-20 16:34:09Z eric $

pkgname=perl-guard
pkgver=1.022
pkgrel=2
pkgdesc="safe cleanup blocks"
arch=(i686 x86_64)
license=(custom:unknown)
options=(!emptydirs)
depends=('perl')
url=https://metacpan.org/release/Guard
source=("http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/Guard-${pkgver}.tar.gz")
md5sums=(8d1d8b942fd5d0240f47906a6d6fac8c)
sha512sums=(9eb1c4fa29f6190115fe11215ff5d27bb3e7f5ab60c7f40c4142ad9ff8aad91b0b169204e4d0f1b1638381c0c99e6a0b5627b8b6d60fad62f1392a9d1e49751e)
_distdir="${srcdir}/Guard-${pkgver}"

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor"     \
      PERL_MB_OPT="--installdirs vendor" \
      MODULEBUILDRC=/dev/null

    cd "$_distdir"
    /usr/bin/perl Makefile.PL
    make
  )
}

check() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd "$_distdir"
    make test
  )
}

package() {
    cd "$_distdir"
    make DESTDIR="$pkgdir" install
}

# Local Variables:
# mode: shell-script
# sh-basic-offset: 2
# End:
# vim:set ts=2 sw=2 et:
